#pragma once

#include <string>
#include <vector>
#include <map>
#include <boost\lexical_cast.hpp>

using namespace std;
using namespace boost;

enum eEVENT_LEVEL
{
	LV_INVALID = -1,
	LV_EVENT = 0,
	LV_WARNING,
	LV_ERROR
};

struct LOG_PACKAGE
{
	eEVENT_LEVEL  m_level;
	wstring       m_wstrTime;
	wstring       m_wstrMsg;
};

class CSystemLog
{
public:
	CSystemLog();
	CSystemLog(wstring wstrFolderName);
	~CSystemLog();
	HWND m_hUiHandle;
	void DisplayLog(wstring strMsg, bool bHighResolution = true);
	void FlushLogCache();
	void DisplayLogAndSave(wstring strMsg, eEVENT_LEVEL m_uacLevel);

	HWND m_hUiHandle_Mes;
	//void FlushMesLog();
	//void DisplayMesLog(wstring strMsg, eEVENT_LEVEL nLevel);

private:
	wstring          m_wstrPath;
	wstring          m_wstrLastLog;
	CString          m_sLastLogMsg;
	CRITICAL_SECTION m_csLogger;
	std::multimap<wstring, wstring> m_dictLogMsg;
	std::multimap<wstring, wstring> m_dictMesLog;
};
extern CSystemLog gSystemLog;

